<script setup>
import { ref } from 'vue'
import router from "@/router/index.js";
const checked = ref([{label:'备选项1',value:1},
  {label: '备选项2', value: 2},{label: '备选项3', value: 3}])
const onChecked = ref([])
// 复选框绑定的是数组，数组里面存储的是 value绑定的值
</script>

<template>
  <el-button @click="router.push('/image?id=1')">
    访问/image并且传递参数id=1  </el-button>
  <el-button @click="router.push({path:'/image',query:{id:1,name:'周霸王'}})">
    访问/image并且传递参数id=1，name='周霸王' </el-button>
  <div>
    <div>
    <el-checkbox-group v-model="onChecked">
      <el-checkbox v-for="item in checked" :label= "item.label" :key="item.value" :value="item.value"></el-checkbox>
    </el-checkbox-group>
      <div>
        {{onChecked}}
      </div>
    </div>
  </div>

</template>

